<template>
	<view class="dt">
		<view class="title">基本信息：</view>
		<uni-list>
			<uni-list-item class="hasMsg" title="单号：" :rightText="list.order_number"></uni-list-item>
			<uni-list-item class="hasStu" title="订单类型：" v-if="list.is_huizhen == '1'" rightText="会诊订单"></uni-list-item>
			
			<uni-list-item class="hasStu" title="状态：" v-if="list.status == '0'" rightText="待支付"></uni-list-item>
			<uni-list-item class="hasStu" title="状态：" v-else-if="list.status == '1'" rightText="待接单"></uni-list-item>
			<uni-list-item class="hasStu" title="状态：" v-else-if="list.status == '2'" rightText="待发药"></uni-list-item>
			<uni-list-item class="hasStu" title="状态：" v-else-if="list.status == '3'" rightText="已发药"></uni-list-item>
			<uni-list-item class="hasStu" title="状态：" v-else-if="list.status == '4'" rightText="已签收"></uni-list-item>
			<uni-list-item class="hasStu" title="状态：" v-else rightText="已完成"></uni-list-item>
			
			<uni-list-item class="hasNoData" title="会诊佣金：" v-if="list.is_huizhen == '1'" :rightText="'￥'+list.huizhen.price2"></uni-list-item>
			<uni-list-item class="hasNoData" title="实付金额：" :rightText="'￥'+list.price"></uni-list-item>
			<uni-list-item v-if="list.pay_time" class="hasMsg" title="患者付款：" :rightText="list.pay_time"></uni-list-item>
			<uni-list-item v-if="list.jiedan_time" class="hasMsg" title="药房接单：" :rightText="list.jiedan_time"></uni-list-item>
			<uni-list-item v-if="list.qianshou_time" class="hasMsg" title="签收：" :rightText="list.qianshou_time"></uni-list-item>
		</uni-list>
		
		<view class="title">患者信息：</view>
		<uni-list>
			<uni-list-item class="hasMsg hasStu" title="患者姓名：" :rightText="list.user.name + list.user.nianling"></uni-list-item>
			<uni-list-item class="hasMsg" title="患者性别：" v-if="list.user.sex == 1" rightText="男"></uni-list-item>
			<uni-list-item class="hasMsg" title="患者性别：" v-else rightText="女"></uni-list-item>
			<uni-list-item class="hasMsg" title="中医诊断：" :rightText="list.kaifang.zhenduan"></uni-list-item>
		</uni-list>
		<view class="title">开方信息：</view>
		<uni-list v-if="list.status == 0">
			<uni-list-item v-for="(i,k) in list.kaifang_list" :key="k" class="hasMsg hasStu" :title="'药材'+'：'" :rightText="i.name"></uni-list-item>
		</uni-list>
		<uni-list v-else>
			<uni-list-item v-for="(i,k) in list.kaifang_list" :key="k" class="hasMsg hasStu" :title="'药材'+'：'" :rightText="i.name+' '+i.num+'g'+' '+i.yongfa"></uni-list-item>
		</uni-list>
		<view class="title">处方信息：</view>
		<uni-list>
			<uni-list-item class="hasMsg" title="方剂类型：" :rightText="list.type"></uni-list-item>
			<uni-list-item class="hasMsg" title="剂型：" :rightText="list.type"></uni-list-item>
			<uni-list-item class="hasMsg" title="取药方式：" rightText="快递"></uni-list-item>
			<uni-list-item class="hasMsg" title="用法：" v-if="list.yongfa == 0" rightText="内服"></uni-list-item>
			<uni-list-item class="hasMsg" title="用法：" v-else rightText="外用"></uni-list-item>
			<uni-list-item class="hasMsg" title="剂数：" :rightText="list.kaifang.jishu+'剂'"></uni-list-item>
			<uni-list-item class="hasMsg" title="每日：" :rightText="list.kaifang.meiri+'剂'"></uni-list-item>
			<uni-list-item class="hasMsg" title="一剂分几次：" :rightText="list.kaifang.jifen+'次'"></uni-list-item>
			<uni-list-item class="hasMsg" title="每次多少：" :rightText="list.kaifang.meici+'ml'"></uni-list-item>
			<!-- <uni-list-item class="hasMsg" title="取发药：" rightText="加急"></uni-list-item> -->
			<uni-list-item class="hasMsg" title="医嘱：" :rightText="list.kaifang.yizhu"></uni-list-item>
		</uni-list>
		
		<view v-if="list.kuaidi_name">
			<view class="title">快递信息：</view>
			<uni-list>
				<uni-list-item class="hasMsg" title="快递公司：" rightText="顺丰快递"></uni-list-item>
				<uni-list-item v-if="list.kuaidi_num" class="hasMsg" title="快递单号：" :rightText="list.kuaidi_num"></uni-list-item>
				<uni-list-item class="hasMsg" title="收货人：" :rightText="list.kuaidi_name"></uni-list-item>
				<uni-list-item class="hasMsg" title="手机号码：" :rightText="list.kuaidi_phone"></uni-list-item>
				<uni-list-item class="hasMsg" title="收货地址：" :rightText="list.province_name+list.city_name+list.area_name+list.address"></uni-list-item>
				<view v-if="wlxx.length!=0">
					<uni-list-item class="hasMsg" title="物流信息：" rightText="">
						<template slot="footer">
							<view class="docSign2">
								<view class="text" v-for="(i,k) in wlxx" :key="k">{{i.time}}：{{i.context}}</view>
							</view>
						</template>
					</uni-list-item>
				</view>
			</uni-list>
		</view>
		
		<view v-if="list.status == '0'" class="speed" @click="nowPay">去支付</view>
		<view style="height: 1upx;"></view>
		<!-- <view class="title">费用明细：</view>
		<uni-list>
			<uni-list-item class="hasMsg" title="总金额：" rightText="￥17.35"></uni-list-item>
			<uni-list-item class="hasMsg" title="会员折扣：" rightText="95%"></uni-list-item>
			<uni-list-item class="hasMsg" title="折扣金额：" rightText="￥0.87"></uni-list-item>
			<uni-list-item class="hasMsg" title="支付金额：" rightText="￥16.48"></uni-list-item>
			<uni-list-item class="hasMsg" title="支付方式：" rightText="支付宝记账"></uni-list-item>
			<uni-list-item class="hasNoData" title="实际收入：" rightText="￥16.48"></uni-list-item> 
		</uni-list> -->
	</view>
</template>

<script>
	import {
		cfxq
	} from '../../request/api.js'
	export default {
		data() {
			return {
				id:'',
				list:{
					user:{
						name:"",
						nianling:""
					},
					kaifang:{
						zhenduan:'',
						yongfa:'',
						jishu:'',
						meiri:'',
						jifen:'',
						meici:'',
						yizhu:'',
					}
				},
				wlxx:[]
			}
		},
		onLoad(options) {
			this.id = options.id;
			cfxq({oid:options.id}).then(res=>{
				this.list = res.data
				if(this.list.kd_content){
					this.wlxx = JSON.parse(this.list.kd_content).data.data
				}
			})
		},
		methods: {
			nowPay(){
				uni.navigateTo({
					url:'/pages/centrum/pay?id='+this.id
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.dt{
		padding:0 30upx;
		font-size: 30upx;
		line-height: 160%;
		
		.title{
			font-size: 32upx;
			font-weight: bold;
			margin-top: 30upx;
		}
		
		::v-deep .hasMsg{
			.uni-list-item__extra-text{
				color: #9F9F9F;
				flex: 1;
				width:470upx;
				text-align: right;
			}
		}
		::v-deep .hasNoData{
			.uni-list-item__extra-text{
				color: #F86C53;
			}
		}
		::v-deep .hasStu{
			.uni-list-item__extra-text{
				color: #0000FF;
			}
		}
		
		::v-deep .uni-list-item__content-title {
			font-size: 30upx;
			color: #000000;
		}
		
		::v-deep .uni-icons {
			padding: 0;
		}
		
		::v-deep .uni-list-item__container {
			padding-left: 0;
			padding-right: 0;
		}
		::v-deep .uni-list-item__extra-text{
			color: #000000;
			font-size: 28upx;
		}
		::v-deep .uni-list--border-top{
			height: 0px;
		}
		.docSign2{
			text-align: justify;
			width: 500upx;
			
			.text{
				margin-bottom: 15upx;
				font-size: 28upx;
				color: #9F9F9F;
			}
		}
		.speed {
			width: 220px;
			background: #FDF4F5;
			border: 1px solid #F86C53;
			border-radius: 16px;
			font-size: 32upx;
			font-family: Source Han Sans CN;
			font-weight: 400;
			color: #F86C53;
			padding: 5px 0;
			text-align: center;
			margin: 50upx auto;
		}
	}
	
</style>
